#include "AddRowNetworkEvent.h"
#include "Well.h"

AddRowNetworkEvent::AddRowNetworkEvent(long rowId, int rowNo)
{
    message.header.code = NetworkEvent::SERVER_ADD_ROW;
    message.header.sizeOfData = sizeof(message) - sizeof(message.header);
    message.data.rowId = rowId;
    message.data.rowNo = rowNo;
}

AddRowNetworkEvent::AddRowNetworkEvent(const Header& header, const Data& data)
{
    message.header = header;
    message.data = data;
}

AddRowNetworkEvent::~AddRowNetworkEvent()
{
}

void* AddRowNetworkEvent::getMessageBlob()
{
    return &message;
}

void AddRowNetworkEvent::visitWell(Well* well) const
{
    well->handleAddRowEvent(message.data.rowId, message.data.rowNo);
}

size_t AddRowNetworkEvent::getMessageBlobSize()
{
    return sizeof(message);
}
